package com.itheima.SmartHome;

public class JD implements SmartHome {
    private String name;
    //开关
    private boolean power;
    public JD(){};
    public JD(String name,boolean power)
    {
        this.name=name;
        this.power=power;
    }

    //开关功能
    @Override
    public void push() {
        power = !power;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isPower() {
        return power;
    }

    public void setPower(boolean power) {
        this.power = power;
    }

    @Override
    public String toString() {
        return "JD{" +
                "name='" + name + '\'' +
                ", power=" + power +
                '}';
    }
}
